package com.chain;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(200)
public class SecondAspect {


    // @Around("execution(* com.service.impl.UserServieImpl.add(int,int))")
    @Around("within( com.service)")
    public Object around(ProceedingJoinPoint joinPoint) {


        Object result = null;
        try {
            System.out.println("222 around before---");
            result = joinPoint.proceed();
            System.out.println("222 around after---");

        } catch (Throwable e) {

            e.printStackTrace();
        }

        return result;
    }

}
